package com.hyzx.qbasic.admin.domain.service;

import com.github.pagehelper.PageInfo;
import com.hyzx.qbasic.admin.common.security.UrlFilter;
import com.hyzx.qbasic.admin.model.dto.AuthorizationInfo;
import com.hyzx.qbasic.admin.model.dto.MenuInfo;
import com.hyzx.qbasic.admin.model.dto.MenuListInfo;
import com.hyzx.qbasic.admin.model.dto.ResourceTreeInfo;
import com.hyzx.qbasic.admin.model.po.ResourceInfoPO;
import com.hyzx.qbasic.admin.model.po.ResourcePO;
import com.hyzx.qbasic.admin.model.vo.req.admin.AddResourceReq;
import com.hyzx.qbasic.admin.model.vo.req.admin.DeleteResourceReq;
import com.hyzx.qbasic.admin.model.vo.req.admin.EditResourceReq;
import com.hyzx.qbasic.admin.model.vo.req.admin.GetResourceListReq;
import com.hyzx.qbasic.admin.model.vo.res.BaseOperationRes;

import java.util.List;
import java.util.Optional;

/**
 * Created by 黄江华 on 2017/10/9
 */

public interface IPermissionService {

    AuthorizationInfo getUserAuthorizationInfo(int userId);

    List<MenuListInfo> getUserMenuList(int userId);

    List<MenuInfo> getUserFunctionList(int userId);

    Optional<MenuInfo> getFunction(int userId, String permission);

    List<ResourceTreeInfo> getAllResourceList();

    PageInfo<ResourceInfoPO> getPagedResourceList(GetResourceListReq req);

    BaseOperationRes addResource(AddResourceReq req);

    ResourcePO getResourceInfo(int resourceId);

    BaseOperationRes editResource(EditResourceReq req);

    BaseOperationRes deleteResource(DeleteResourceReq req);

    List<UrlFilter> getAllUrlFilterList();
}
